package com.demo.matchfind;

import com.demo.common.Dish;
import com.demo.common.DishUtil;

import java.util.List;
import java.util.Optional;

public class TestFindAny {
    public static void main(String[] args) {
        List<Dish> menu = DishUtil.getDishes();
        Optional<Dish> dish = menu.stream()
                                  .filter(Dish::isVegetarian)
                                  .findAny();
        dish.ifPresent(d -> System.out.println(d.getName()));
    }
}
